function Person() {
  this.name = "hugo";
}
const obj = new Person();
console.log(obj instanceof Person);

function instance_of(obj, Constructor) {
  let implictiPrototype = obj.__proto__;
  let displayPrototype = Constructor.prototype;
  while (true) {
    if (implictiPrototype === null) {
      return false;
    } else if (implictiPrototype === displayPrototype) {
      return true;
    }
    implictiPrototype = implictiPrototype.__proto__;
  }
}

const has = instance_of(obj, Person);
console.log(has);
